package com.rmt.www.action;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts2.ServletActionContext;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;


import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.rmt.www.constant.ArtifactType;
import com.rmt.www.dao.ArtifactDao;
import com.rmt.www.dao.ProjectDao;
import com.rmt.www.dao.TraceabilityDao;
import com.rmt.www.dao.UserDao;
import com.rmt.www.service.AdminManageTraceabilityService;
import com.rmt.www.vo.Artifact;
import com.rmt.www.vo.Cell;
import com.rmt.www.vo.Project;
import com.rmt.www.vo.User;


public class GetTraceAction extends ActionSupport{
	private int pid;
	private String from;
	private String to;
	private List<List<Cell>> matrix;
	private List<Cell> row;
	private List<Artifact> fromList;
	private List<Artifact> toList;
	private AdminManageTraceabilityService adminManageTraceabilityService;
		

	public AdminManageTraceabilityService getAdminManageTraceabilityService() {
		return adminManageTraceabilityService;
	}

	public void setAdminManageTraceabilityService(
			AdminManageTraceabilityService adminManageTraceabilityService) {
		this.adminManageTraceabilityService = adminManageTraceabilityService;
	}

	public List<Artifact> getFromList() {
		return fromList;
	}

	public void setFromList(List<Artifact> fromList) {
		this.fromList = fromList;
	}

	public List<Artifact> getToList() {
		return toList;
	}

	public void setToList(List<Artifact> toList) {
		this.toList = toList;
	}

	public String getFrom() {
		return from;
	}

	public void setFrom(String from) {
		this.from = from;
	}

	public String getTo() {
		return to;
	}

	public void setTo(String to) {
		this.to = to;
	}

	public List<List<Cell>> getMatrix() {
		return matrix;
	}

	public void setMatrix(List<List<Cell>> matrix) {
		this.matrix = matrix;
	}

	public List<Cell> getRow() {
		return row;
	}

	public void setRow(List<Cell> row) {
		this.row = row;
	}

	public int getPid() {
		return pid;
	}

	public void setPid(int pid) {
		this.pid = pid;
	}
	
	public String execute(){
		matrix=adminManageTraceabilityService.getTraceMatrix(from, to, pid);
		return "success";
	}
}
